# Maintainer: Daurnimator <daurnimator@archlinux.org>

# The list of utilities can be found at
# https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html

# Not all utilities are required: if the synopsis is entirely shaded and
# annotated with a code, it is only needed for that code. Examples: user
# portability, XSI, Software Development, C Development. Some of these groups
# were implemented here too, though almost certainly the only important ones
# are UP and XSI.

pkgbase=posix
pkgname=('posix' 'posix-xsi' 'posix-user-portability' 'posix-c-development' 'posix-software-development')
pkgver=2017
pkgrel=3
pkgdesc="metapackage providing the POSIX shell and utilities (XCU)"
arch=('any')
url="https://pubs.opengroup.org/onlinepubs/9699919799/"
# Metapackages have no copyrightable content. On request, make that an
# actual metadata line in the built package. Note: namcap still reports
# one error, but a different one.
license=('None')
depends=('at' # at batch
         'awk'
         'coreutils' # basename cat chgrp chmod chown cksum comm cp csplit cut date dd df dirname
                     # du echo env expand expr false fold head id join ln logname ls mkdir mkfifo
                     # mv nice nohup od paste pathchk pr printf pwd rm rmdir sleep sort split stty
                     # tail tee test touch tr true tsort tty uname unexpand uniq unlink wc who
         'bc'
         'diffutils' # cmp diff
         'ed'
         'file'
         'findutils' # find xargs
         'glibc' # gencat getconf iconv locale localedef
         'grep'
         'util-linux' # kill logger mesg newgrp renice write
         'cups' # lp -- sorry!
         'm4'
         's-nail' # mailx
         'man' # virtual, two providers
         'patch'
         'pax'
         'procps-ng' # ps
         'sed'
         'sh'
         'binutils' # strings
         'ncurses' # tabs tput
         'time' # -- is not required to be a convenient shell builtin, dash doesn't have it
         'sharutils' # uudecode uuencode
)

package_posix() {
    :
}

package_posix-xsi() {
    pkgdesc+=": X/Open System Interfaces"
    depends=('posix'
             'util-linux' # cal ipcrm ipcs kill
             'ncompress' # compress
             'coreutils' # df link nl od
             'psmisc' # fuser
             'procps-ng' # ps
             'ncurses' # tabs
             'gzip' # uncompress (but not compress...) zcat
             'uucp' # uucp uustat uux
             # missing: cflow cxref
             # missing SCCS: admin delta get prs rmdel sact sccs unget val what
    )
    install=xsi.install
}

package_posix-user-portability() {
    pkgdesc+=": User Portability Utilities"
    depends=('posix'
             'cronie' # crontab
             'vi' # ex vi
             'util-linux' # more
             'inetutils' # talk
    )
}

package_posix-c-development() {
    pkgdesc+=": C-Language Development Utilities"
    depends=('posix'
             'gcc' # c99
             'flex' # lex
             'bison' # yacc
    )
}

package_posix-software-development() {
    pkgdesc+=": Software Development"
    depends=('posix'
             'binutils' # ar nm strip
             'ctags'
             'make'
    )
}
